#include "BulletCollision/Gimpact/btTriangleShapeEx.h"
#ifdef __cplusplus
extern "C" {
#endif
btTriangleShapeEx* bullet_NewbtTriangleShapeEx(){
	btTriangleShapeEx* wrap_out = new btTriangleShapeEx();
	return wrap_out;
}

btTriangleShapeEx* bullet_NewbtTriangleShapeEx1(btVector3* p0,btVector3* p1,btVector3* p2){
	btVector3 const& c_arg_p0=(btVector3 const&)(*p0);
	btVector3 const& c_arg_p1=(btVector3 const&)(*p1);
	btVector3 const& c_arg_p2=(btVector3 const&)(*p2);
	btTriangleShapeEx* wrap_out = new btTriangleShapeEx(c_arg_p0,c_arg_p1,c_arg_p2);
	return wrap_out;
}

btTriangleShapeEx* bullet_NewbtTriangleShapeEx2(btTriangleShapeEx* other){
	btTriangleShapeEx const& c_arg_other=(btTriangleShapeEx const&)(*other);
	btTriangleShapeEx* wrap_out = new btTriangleShapeEx(c_arg_other);
	return wrap_out;
}

void bullet_btTriangleShapeEx_applyTransform(btTriangleShapeEx* c_this,btTransform* t){
	btTransform const& c_arg_t=(btTransform const&)(*t);
	c_this->applyTransform(c_arg_t);
}

void bullet_btTriangleShapeEx_buildTriPlane(btTriangleShapeEx* c_this,btVector4* plane){
	btVector4& c_arg_plane=(btVector4&)(*plane);
	c_this->buildTriPlane(c_arg_plane);
}

bool bullet_btTriangleShapeEx_overlap_test_conservative(btTriangleShapeEx* c_this,btTriangleShapeEx* other){
	btTriangleShapeEx const& c_arg_other=(btTriangleShapeEx const&)(*other);
	bool c_out = c_this->overlap_test_conservative(c_arg_other);
	bool wrap_out = (c_out);
	return wrap_out;
}

btPrimitiveTriangle* bullet_NewbtPrimitiveTriangle(){
	btPrimitiveTriangle* wrap_out = new btPrimitiveTriangle();
	return wrap_out;
}

void bullet_btPrimitiveTriangle_applyTransform(btPrimitiveTriangle* c_this,btTransform* t){
	btTransform const& c_arg_t=(btTransform const&)(*t);
	c_this->applyTransform(c_arg_t);
}

void bullet_btPrimitiveTriangle_buildTriPlane(btPrimitiveTriangle* c_this){
	c_this->buildTriPlane();
}

int bullet_btPrimitiveTriangle_clip_triangle(btPrimitiveTriangle* c_this,btPrimitiveTriangle* other,btVector3* clipped_points){
	btPrimitiveTriangle& c_arg_other=(btPrimitiveTriangle&)(*other);
	btVector3 * c_arg_clipped_points=(btVector3 *)(void*)(clipped_points);
	int c_out = c_this->clip_triangle(c_arg_other,c_arg_clipped_points);
	int wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btPrimitiveTriangle_find_triangle_collision_clip_method(btPrimitiveTriangle* c_this,btPrimitiveTriangle* other,GIM_TRIANGLE_CONTACT* contacts){
	btPrimitiveTriangle& c_arg_other=(btPrimitiveTriangle&)(*other);
	GIM_TRIANGLE_CONTACT& c_arg_contacts=(GIM_TRIANGLE_CONTACT&)(*contacts);
	bool c_out = c_this->find_triangle_collision_clip_method(c_arg_other,c_arg_contacts);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_btPrimitiveTriangle_get_edge_plane(btPrimitiveTriangle* c_this,int edge_index,btVector4* plane){
	int c_arg_edge_index=edge_index;
	btVector4& c_arg_plane=(btVector4&)(*plane);
	c_this->get_edge_plane(c_arg_edge_index,c_arg_plane);
}

double bullet_btPrimitiveTriangle_GetFieldOfM_dummy(btPrimitiveTriangle* c_this){
	return (double)(c_this->m_dummy);
}

double bullet_btPrimitiveTriangle_GetFieldOfM_margin(btPrimitiveTriangle* c_this){
	return (double)(c_this->m_margin);
}

btVector4* bullet_btPrimitiveTriangle_GetFieldOfM_plane(btPrimitiveTriangle* c_this){
	return (btVector4*)(&c_this->m_plane);
}

btVector3** bullet_btPrimitiveTriangle_GetFieldOfM_vertices(btPrimitiveTriangle* c_this){
	return (btVector3**)(&c_this->m_vertices);
}

bool bullet_btPrimitiveTriangle_overlap_test_conservative(btPrimitiveTriangle* c_this,btPrimitiveTriangle* other){
	btPrimitiveTriangle const& c_arg_other=(btPrimitiveTriangle const&)(*other);
	bool c_out = c_this->overlap_test_conservative(c_arg_other);
	bool wrap_out = (c_out);
	return wrap_out;
}

GIM_TRIANGLE_CONTACT* bullet_NewGIM_TRIANGLE_CONTACT(){
	GIM_TRIANGLE_CONTACT* wrap_out = new GIM_TRIANGLE_CONTACT();
	return wrap_out;
}

GIM_TRIANGLE_CONTACT* bullet_NewGIM_TRIANGLE_CONTACT1(GIM_TRIANGLE_CONTACT* other){
	GIM_TRIANGLE_CONTACT const& c_arg_other=(GIM_TRIANGLE_CONTACT const&)(*other);
	GIM_TRIANGLE_CONTACT* wrap_out = new GIM_TRIANGLE_CONTACT(c_arg_other);
	return wrap_out;
}

void bullet_GIM_TRIANGLE_CONTACT_copy_from(GIM_TRIANGLE_CONTACT* c_this,GIM_TRIANGLE_CONTACT* other){
	GIM_TRIANGLE_CONTACT const& c_arg_other=(GIM_TRIANGLE_CONTACT const&)(*other);
	c_this->copy_from(c_arg_other);
}

double bullet_GIM_TRIANGLE_CONTACT_GetFieldOfM_penetration_depth(GIM_TRIANGLE_CONTACT* c_this){
	return (double)(c_this->m_penetration_depth);
}

int bullet_GIM_TRIANGLE_CONTACT_GetFieldOfM_point_count(GIM_TRIANGLE_CONTACT* c_this){
	return (int)(c_this->m_point_count);
}

btVector3** bullet_GIM_TRIANGLE_CONTACT_GetFieldOfM_points(GIM_TRIANGLE_CONTACT* c_this){
	return (btVector3**)(&c_this->m_points);
}

btVector4* bullet_GIM_TRIANGLE_CONTACT_GetFieldOfM_separating_normal(GIM_TRIANGLE_CONTACT* c_this){
	return (btVector4*)(&c_this->m_separating_normal);
}

void bullet_GIM_TRIANGLE_CONTACT_merge_points(GIM_TRIANGLE_CONTACT* c_this,btVector4* plane,double margin,btVector3* points,int point_count){
	btVector4 const& c_arg_plane=(btVector4 const&)(*plane);
	btScalar c_arg_margin=margin;
	btVector3 const * c_arg_points=(btVector3 const *)(void*)(points);
	int c_arg_point_count=point_count;
	c_this->merge_points(c_arg_plane,c_arg_margin,c_arg_points,c_arg_point_count);
}

#ifdef __cplusplus
}
#endif
